package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.CreditCatalog;
import cn.wolfcode.trip.base.mapper.CreditCatalogMapper;
import cn.wolfcode.trip.base.service.ICreditCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CreditCatalogServiceImpl implements ICreditCatalogService {
    @Autowired
    private CreditCatalogMapper creditCatalogMapper;


    @Override
    public void save(CreditCatalog creditCatalog) {
        creditCatalogMapper.insert(creditCatalog);
    }

    @Override
    public void delete(Long id) {
        creditCatalogMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<CreditCatalog> selectAll() {
        return creditCatalogMapper.selectAll();
    }

    @Override
    public void update(CreditCatalog creditCatalog) {
        creditCatalogMapper.updateByPrimaryKey(creditCatalog);
    }

    @Override
    public CreditCatalog get(Long id) {
        return creditCatalogMapper.selectByPrimaryKey(id);
    }
}
